import random

from fontTools.misc.cython import returns

s = [random.randint(1,100) for i in range(10)]
s.sort()
print(s)

n = int(input("请输入待查数："))

left = 0
right = len(s)-1
mid = -1
flag = False
while left<right:
    mid = (left + right) // 2
    if s[mid] == n:
        flag = True
        break
    elif s[mid]>n:
        right = mid-1
    elif s[mid]<n:
        left = mid+1

if flag:
    print(f"{n}的下标为{mid}")
else:
    print("没找到")